package com.jt.provider.service;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class ResourceBlockHandler {
    private static final Logger log = LoggerFactory.getLogger(ResourceService.class);

    public static String call(BlockException ex){
        log.error("block exception {}", "@SentinelResource 描述的方法执行时限流了",ex.getMessage());
        return "访问频繁，稍等片刻";
    }

}
